home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / contrib / is-alpha.bst < prev    next >
Text File  |  1994-05-29  |  30KB  |  1,655 lines

  1. %% =====================================================================
  2. %% WARNING: Do NOT edit this file.  It was produced automatically by
  3. %% Nelson H. F. Beebe <beebe@plot79.math.utah.edu>
  4. %% from /a/csc-sun/export/home/csc-sun/b/beebe/tex/bib/merge/xbtxbst.doc 
  5. %% on Mon May 30 18:18:12 MDT 1994
  6. %% =====================================================================
  7. %%%=====================================================================
  8. %%% @BibTeX-style-file{
  9. %%%     author          = "Nelson H. F. Beebe",
  10. %%%     version         = "1.05",
  11. %%%     date            = "30 May 1994",
  12. %%%     time            = "18:05:20 MDT",
  13. %%%     filename        = "is-alpha.bst",
  14. %%%     address         = "Center for Scientific Computing
  15. %%%                        Department of Mathematics
  16. %%%                        University of Utah
  17. %%%                        Salt Lake City, UT 84112
  18. %%%                        USA",
  19. %%%     telephone       = "+1 801 581 5254",
  20. %%%     FAX             = "+1 801 581 4148",
  21. %%%     checksum        = "34960 1654 3728 30498",
  22. %%%     email           = "beebe@math.utah.edu (Internet)",
  23. %%%     codetable       = "ISO/ASCII",
  24. %%%     keywords        = "BibTeX, style, bibliography",
  25. %%%     supported       = "yes",
  26. %%%     docstring       = "This file is a modification of the standard
  27. %%%                        BibTeX btxbst.doc file, or is a .bst file
  28. %%%                        derived from that modification.  It contains
  29. %%%                        added support for ISBN and ISSN fields, as
  30. %%%                        well as for the PERIODICAL entry.  The UNIX C
  31. %%%                        preprocessor can be used to extract the
  32. %%%                        extensions of the standard styles, as
  33. %%%                        follows:
  34. %%%
  35. %%%                        cpp -P -DPLAIN xbtxbst.doc is-plain.txt
  36. %%%                        cpp -P -DUNSRT xbtxbst.doc is-unsrt.txt
  37. %%%                        cpp -P -DALPHA xbtxbst.doc is-alpha.txt
  38. %%%                        cpp -P -DABBRV xbtxbst.doc is-abbrv.txt
  39. %%%
  40. %%%                        Add -D_ISBN for ISBN output, -D_ISSN for
  41. %%%                        ISSN output, -D_LCCN for LCCN output,
  42. %%%                        -D_PRICE for price output, and -D_BOOKPAGES
  43. %%%                        for book and techreport pages output.
  44. %%%
  45. %%%                        Add -D_NUMERIC_SUFFIXES to get numeric
  46. %%%                        label suffixes -1, -2, ..., -26, instead of
  47. %%%                        letters a, b, ..., z, so as to correctly
  48. %%%                        handle alpha-style bibliographies with more
  49. %%%                        than 26 entries for a single author in one
  50. %%%                        year.  Change letter suffix code to switch
  51. %%%                        to numeric suffixes if more than 26 letters
  52. %%%                        are used, so that no matter which scheme is
  53. %%%                        selected, correct output will always be
  54. %%%                        obtained.
  55. %%%
  56. %%%                        If desired, a sed script can be used to
  57. %%%                        eliminate non-essential comments (this
  58. %%%                        reduces the file size by 2/3); a command
  59. %%%                        filter step like
  60. %%%                                sed -e '/^%$/d' -e '/^%[^%].*$/d'
  61. %%%                        will accomplish that job.
  62. %%%
  63. %%%                        The checksum field above contains a CRC-16
  64. %%%                        checksum as the first value, followed by the
  65. %%%                        equivalent of the standard UNIX wc (word
  66. %%%                        count) utility output of lines, words, and
  67. %%%                        characters.  This is produced by Robert
  68. %%%                        Solovay's checksum utility."
  69. %%%     }
  70. %%% ====================================================================
  71. %%% Revision history (reverse time order):
  72. %%% 1.05 [30-May-1994]
  73. %%%     Add NUMERIC_SUFFIXES support.
  74. %%%
  75. %%%     Change all preprocessor statements to put else and endif
  76. %%%     labels inside C-style comments to conform to 1989 ISO/ANSI C
  77. %%%     Standard.
  78. %%% 1.04 [11-Nov-1993]
  79. %%%     Add underscore prefix to new processor symbols to prevent
  80. %%%     substitution in comments
  81. %%% 1.03 [11-Oct-1993]
  82. %%%     Add support for LCCN (Library of Congress Catalog Number)
  83. %%%     and price fields, and make ISBN, ISSN, LCCN, and price
  84. %%%     selectable by preprocessor conditionals.
  85. %%% 1.02 [12-Sep-1991]
  86. %%%      Merge in Barbara N. Beeton's suggestion for hyphen-less
  87. %%%      line breaks around volume(number):page.
  88. %%% 1.01 [10-Sep-1991]
  89. %%%      Update file comment header and use Solovay checksum program.
  90. %%% 1.00 [17-Oct-1990]
  91. %%%      Original version merging hand-edits of is-xxx.bst files into
  92. %%%      this master file, xbtxbst.doc.
  93.  
  94.  
  95. %% BibTeX `plain' family
  96. %%       version 0.99b for BibTeX versions 0.99a or later, LaTeX version 2.09.
  97. %%       Copyright (C) 1985, all rights reserved.
  98. %%       Copying of this file is authorized only if either
  99. %%       (1) you make absolutely no changes to your copy, including name, or
  100. %%       (2) if you do make changes, you name it something other than
  101. %%       btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
  102. %%       This restriction helps ensure that all standard styles are identical.
  103. %%       The file btxbst.doc has the documentation for this style.
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119. ENTRY
  120.   { address
  121.     author
  122.     booktitle
  123.     chapter
  124.     edition
  125.     editor
  126.     howpublished
  127.     institution
  128.  
  129.     isbn
  130.  
  131.  
  132.     issn
  133.  
  134.     journal
  135.     key
  136.  
  137.     lccn
  138.  
  139.     month
  140.     note
  141.     number
  142.     organization
  143.     pages
  144.  
  145.     price
  146.  
  147.     publisher
  148.     school
  149.     series
  150.     title
  151.     type
  152.     volume
  153.     year
  154.   }
  155.   {}
  156.  
  157.  
  158.   { label extra.label sort.label }
  159.  
  160.  
  161.  
  162.  
  163. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  164.  
  165. FUNCTION {init.state.consts}
  166. { #0 'before.all :=
  167.   #1 'mid.sentence :=
  168.   #2 'after.sentence :=
  169.   #3 'after.block :=
  170. }
  171.  
  172.  
  173. STRINGS { s t }
  174.  
  175. FUNCTION {output.nonnull}
  176. { 's :=
  177.   output.state mid.sentence =
  178.     { ", " * write$ }
  179.     { output.state after.block =
  180.         { add.period$ write$
  181.           newline$
  182.           "\newblock " write$
  183.         }
  184.         { output.state before.all =
  185.             'write$
  186.             { add.period$ " " * write$ }
  187.           if$
  188.         }
  189.       if$
  190.       mid.sentence 'output.state :=
  191.     }
  192.   if$
  193.   s
  194. }
  195.  
  196. FUNCTION {output}
  197. { duplicate$ empty$
  198.     'pop$
  199.     'output.nonnull
  200.   if$
  201. }
  202.  
  203. FUNCTION {output.check}
  204. { 't :=
  205.   duplicate$ empty$
  206.     { pop$ "empty " t * " in " * cite$ * warning$ }
  207.     'output.nonnull
  208.   if$
  209. }
  210.  
  211. FUNCTION {output.bibitem}
  212. { newline$
  213.  
  214.   "\bibitem[" write$
  215.   label write$
  216.   "]{" write$
  217.  
  218.   cite$ write$
  219.   "}" write$
  220.   newline$
  221.   ""
  222.   before.all 'output.state :=
  223. }
  224.  
  225.  
  226. FUNCTION {fin.entry}
  227. { add.period$
  228.   write$
  229.   newline$
  230. }
  231.  
  232. FUNCTION {new.block}
  233. { output.state before.all =
  234.     'skip$
  235.     { after.block 'output.state := }
  236.   if$
  237. }
  238.  
  239. FUNCTION {new.sentence}
  240. { output.state after.block =
  241.     'skip$
  242.     { output.state before.all =
  243.         'skip$
  244.         { after.sentence 'output.state := }
  245.       if$
  246.     }
  247.   if$
  248. }
  249.  
  250.  
  251. FUNCTION {not}
  252. {   { #0 }
  253.     { #1 }
  254.   if$
  255. }
  256.  
  257. FUNCTION {and}
  258. {   'skip$
  259.     { pop$ #0 }
  260.   if$
  261. }
  262.  
  263. FUNCTION {or}
  264. {   { pop$ #1 }
  265.     'skip$
  266.   if$
  267. }
  268.  
  269.  
  270. FUNCTION {new.block.checka}
  271. { empty$
  272.     'skip$
  273.     'new.block
  274.   if$
  275. }
  276.  
  277. FUNCTION {new.block.checkb}
  278. { empty$
  279.   swap$ empty$
  280.   and
  281.     'skip$
  282.     'new.block
  283.   if$
  284. }
  285.  
  286.  
  287. FUNCTION {new.sentence.checka}
  288. { empty$
  289.     'skip$
  290.     'new.sentence
  291.   if$
  292. }
  293.  
  294. FUNCTION {new.sentence.checkb}
  295. { empty$
  296.   swap$ empty$
  297.   and
  298.     'skip$
  299.     'new.sentence
  300.   if$
  301. }
  302.  
  303.  
  304. FUNCTION {field.or.null}
  305. { duplicate$ empty$
  306.     { pop$ "" }
  307.     'skip$
  308.   if$
  309. }
  310.  
  311. FUNCTION {emphasize}
  312. { duplicate$ empty$
  313.     { pop$ "" }
  314.     { "{\em " swap$ * "}" * }
  315.   if$
  316. }
  317.  
  318. INTEGERS { nameptr namesleft numnames }
  319.  
  320. FUNCTION {format.names}
  321. { 's :=
  322.   #1 'nameptr :=
  323.   s num.names$ 'numnames :=
  324.   numnames 'namesleft :=
  325.     { namesleft #0 > }
  326.  
  327.     { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
  328.  
  329.       nameptr #1 >
  330.         { namesleft #1 >
  331.             { ", " * t * }
  332.             { numnames #2 >
  333.                 { "," * }
  334.                 'skip$
  335.               if$
  336.               t "others" =
  337.                 { " et~al." * }
  338.                 { " and " * t * }
  339.               if$
  340.             }
  341.           if$
  342.         }
  343.         't
  344.       if$
  345.       nameptr #1 + 'nameptr :=
  346.       namesleft #1 - 'namesleft :=
  347.     }
  348.   while$
  349. }
  350.  
  351. FUNCTION {format.authors}
  352. { author empty$
  353.     { "" }
  354.     { author format.names }
  355.   if$
  356. }
  357.  
  358. FUNCTION {format.editors}
  359. { editor empty$
  360.     { "" }
  361.     { editor format.names
  362.       editor num.names$ #1 >
  363.         { ", editors" * }
  364.         { ", editor" * }
  365.       if$
  366.     }
  367.   if$
  368. }
  369.  
  370.  
  371. FUNCTION {format.isbn}
  372. { isbn empty$
  373.     { "" }
  374.     { new.block "ISBN " isbn * }
  375.   if$
  376. }
  377.  
  378.  
  379.  
  380. FUNCTION {format.issn}
  381. { issn empty$
  382.     { "" }
  383.     { new.block "ISSN " issn * }
  384.   if$
  385. }
  386.  
  387.  
  388.  
  389. FUNCTION {format.lccn}
  390. { lccn empty$
  391.     { "" }
  392.     { new.block "LCCN " lccn * }
  393.   if$
  394. }
  395.  
  396.  
  397.  
  398. FUNCTION {format.price}
  399. { price empty$
  400.     { "" }
  401.     { new.block " " price * }
  402.   if$
  403. }
  404.  
  405.  
  406.  
  407.  
  408.  
  409. FUNCTION {format.title}
  410. { title empty$
  411.     { "" }
  412.  
  413.     { title "t" change.case$ }
  414.  
  415.   if$
  416. }
  417.  
  418.  
  419.  
  420. FUNCTION {n.dashify}
  421. { 't :=
  422.   ""
  423.     { t empty$ not }
  424.     { t #1 #1 substring$ "-" =
  425.         { t #1 #2 substring$ "--" = not
  426.             { "--" *
  427.               t #2 global.max$ substring$ 't :=
  428.             }
  429.             {   { t #1 #1 substring$ "-" = }
  430.                 { "-" *
  431.                   t #2 global.max$ substring$ 't :=
  432.                 }
  433.               while$
  434.             }
  435.           if$
  436.         }
  437.         { t #1 #1 substring$ *
  438.           t #2 global.max$ substring$ 't :=
  439.         }
  440.       if$
  441.     }
  442.   while$
  443. }
  444.  
  445.  
  446. FUNCTION {format.date}
  447. { year empty$
  448.     { month empty$
  449.         { "" }
  450.         { "there's a month but no year in " cite$ * warning$
  451.           month
  452.         }
  453.       if$
  454.     }
  455.     { month empty$
  456.         'year
  457.         { month " " * year * }
  458.       if$
  459.     }
  460.   if$
  461. }
  462.  
  463.  
  464. FUNCTION {format.btitle}
  465. { title emphasize
  466. }
  467.  
  468.  
  469. FUNCTION {tie.or.space.connect}
  470. { duplicate$ text.length$ #3 <
  471.     { "~" }
  472.     { " " }
  473.   if$
  474.   swap$ * *
  475. }
  476.  
  477.  
  478. FUNCTION {either.or.check}
  479. { empty$
  480.     'pop$
  481.     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  482.   if$
  483. }
  484.  
  485.  
  486. FUNCTION {format.bvolume}
  487. { volume empty$
  488.     { "" }
  489.     { "volume" volume tie.or.space.connect
  490.       series empty$
  491.         'skip$
  492.         { " of " * series emphasize * }
  493.       if$
  494.       "volume and number" number either.or.check
  495.     }
  496.   if$
  497. }
  498.  
  499.  
  500. FUNCTION {format.number.series}
  501. { volume empty$
  502.     { number empty$
  503.         { series field.or.null }
  504.         { output.state mid.sentence =
  505.             { "number" }
  506.             { "Number" }
  507.           if$
  508.           number tie.or.space.connect
  509.           series empty$
  510.             { "there's a number but no series in " cite$ * warning$ }
  511.             { " in " * series * }
  512.           if$
  513.         }
  514.       if$
  515.     }
  516.     { "" }
  517.   if$
  518. }
  519.  
  520.  
  521. FUNCTION {format.edition}
  522. { edition empty$
  523.     { "" }
  524.     { output.state mid.sentence =
  525.         { edition "l" change.case$ " edition" * }
  526.         { edition "t" change.case$ " edition" * }
  527.       if$
  528.     }
  529.   if$
  530. }
  531.  
  532.  
  533. INTEGERS { multiresult }
  534.  
  535. FUNCTION {multi.page.check}
  536. { 't :=
  537.   #0 'multiresult :=
  538.     { multiresult not
  539.       t empty$ not
  540.       and
  541.     }
  542.     { t #1 #1 substring$
  543.       duplicate$ "-" =
  544.       swap$ duplicate$ "," =
  545.       swap$ "+" =
  546.       or or
  547.         { #1 'multiresult := }
  548.         { t #2 global.max$ substring$ 't := }
  549.       if$
  550.     }
  551.   while$
  552.   multiresult
  553. }
  554.  
  555.  
  556. FUNCTION {format.book.pages}
  557. { pages empty$
  558.     { "" }
  559.     { new.block pages " pp." * }
  560.   if$
  561. }
  562.  
  563.  
  564.  
  565. FUNCTION {format.pages}
  566. { pages empty$
  567.     { "" }
  568.     { pages multi.page.check
  569.         { "pages" pages n.dashify tie.or.space.connect }
  570.         { "page" pages tie.or.space.connect }
  571.       if$
  572.     }
  573.   if$
  574. }
  575.  
  576.  
  577. FUNCTION {format.vol.num.pages}
  578. { volume field.or.null
  579.   number empty$
  580.     'skip$
  581.     { "\penalty0 (" number * ")" * *
  582.       volume empty$
  583.         { "there's a number but no volume in " cite$ * warning$ }
  584.         'skip$
  585.       if$
  586.     }
  587.   if$
  588.   pages empty$
  589.     'skip$
  590.     { duplicate$ empty$
  591.         { pop$ format.pages }
  592.         { ":\penalty0 " * pages n.dashify * }
  593.       if$
  594.     }
  595.   if$
  596. }
  597.  
  598.  
  599.  
  600. FUNCTION {format.chapter.pages}
  601. { chapter empty$
  602.     'format.pages
  603.     { type empty$
  604.         { "chapter" }
  605.         { type "l" change.case$ }
  606.       if$
  607.       chapter tie.or.space.connect
  608.       pages empty$
  609.         'skip$
  610.         { ", " * format.pages * }
  611.       if$
  612.     }
  613.   if$
  614. }
  615.  
  616.  
  617. FUNCTION {format.in.ed.booktitle}
  618. { booktitle empty$
  619.     { "" }
  620.     { editor empty$
  621.         { "In " booktitle emphasize * }
  622.         { "In " format.editors * ", " * booktitle emphasize * }
  623.       if$
  624.     }
  625.   if$
  626. }
  627.  
  628.  
  629. FUNCTION {empty.misc.check}
  630. { author empty$ title empty$ howpublished empty$
  631.   month empty$ year empty$ note empty$
  632.   and and and and and
  633.  
  634.   key empty$ not and
  635.  
  636.     { "all relevant fields are empty in " cite$ * warning$ }
  637.     'skip$
  638.   if$
  639. }
  640.  
  641.  
  642. FUNCTION {format.thesis.type}
  643. { type empty$
  644.     'skip$
  645.     { pop$
  646.       type "t" change.case$
  647.     }
  648.   if$
  649. }
  650.  
  651.  
  652. FUNCTION {format.tr.number}
  653. { type empty$
  654.     { "Technical Report" }
  655.     'type
  656.   if$
  657.   number empty$
  658.     { "t" change.case$ }
  659.     { number tie.or.space.connect }
  660.   if$
  661. }
  662.  
  663.  
  664. FUNCTION {format.article.crossref}
  665. { key empty$
  666.     { journal empty$
  667.         { "need key or journal for " cite$ * " to crossref " * crossref *
  668.           warning$
  669.           ""
  670.         }
  671.         { "In {\em " journal * "\/}" * }
  672.       if$
  673.     }
  674.     { "In " key * }
  675.   if$
  676.   " \cite{" * crossref * "}" *
  677. }
  678.  
  679.  
  680. FUNCTION {format.crossref.editor}
  681. { editor #1 "{vv~}{ll}" format.name$
  682.   editor num.names$ duplicate$
  683.   #2 >
  684.     { pop$ " et~al." * }
  685.     { #2 <
  686.         'skip$
  687.         { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  688.             { " et~al." * }
  689.             { " and " * editor #2 "{vv~}{ll}" format.name$ * }
  690.           if$
  691.         }
  692.       if$
  693.     }
  694.   if$
  695. }
  696.  
  697.  
  698. FUNCTION {format.book.crossref}
  699. { volume empty$
  700.     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  701.       "In "
  702.     }
  703.     { "Volume" volume tie.or.space.connect
  704.       " of " *
  705.     }
  706.   if$
  707.   editor empty$
  708.   editor field.or.null author field.or.null =
  709.   or
  710.     { key empty$
  711.         { series empty$
  712.             { "need editor, key, or series for " cite$ * " to crossref " *
  713.               crossref * warning$
  714.               "" *
  715.             }
  716.             { "{\em " * series * "\/}" * }
  717.           if$
  718.         }
  719.         { key * }
  720.       if$
  721.     }
  722.     { format.crossref.editor * }
  723.   if$
  724.   " \cite{" * crossref * "}" *
  725. }
  726.  
  727.  
  728. FUNCTION {format.incoll.inproc.crossref}
  729. { editor empty$
  730.   editor field.or.null author field.or.null =
  731.   or
  732.     { key empty$
  733.         { booktitle empty$
  734.             { "need editor, key, or booktitle for " cite$ * " to crossref " *
  735.               crossref * warning$
  736.               ""
  737.             }
  738.             { "In {\em " booktitle * "\/}" * }
  739.           if$
  740.         }
  741.         { "In " key * }
  742.       if$
  743.     }
  744.     { "In " format.crossref.editor * }
  745.   if$
  746.   " \cite{" * crossref * "}" *
  747. }
  748.  
  749.  
  750. FUNCTION {article}
  751. { output.bibitem
  752.   format.authors "author" output.check
  753.   new.block
  754.   format.title "title" output.check
  755.   new.block
  756.   crossref missing$
  757.     { journal emphasize "journal" output.check
  758.       format.vol.num.pages output
  759.       format.date "year" output.check
  760.     }
  761.     { format.article.crossref output.nonnull
  762.       format.pages output
  763.     }
  764.   if$
  765.   new.block
  766.   note output
  767.   fin.entry
  768. }
  769.  
  770. FUNCTION {book}
  771. { output.bibitem
  772.   author empty$
  773.     { format.editors "author and editor" output.check }
  774.     { format.authors output.nonnull
  775.       crossref missing$
  776.         { "author and editor" editor either.or.check }
  777.         'skip$
  778.       if$
  779.     }
  780.   if$
  781.   new.block
  782.   format.btitle "title" output.check
  783.   crossref missing$
  784.     { format.bvolume output
  785.       new.block
  786.       format.number.series output
  787.       new.sentence
  788.       publisher "publisher" output.check
  789.       address output
  790.     }
  791.     { new.block
  792.       format.book.crossref output.nonnull
  793.     }
  794.   if$
  795.   format.edition output
  796.   format.date "year" output.check
  797.  
  798.   format.isbn output
  799.  
  800.  
  801.   format.book.pages output
  802.  
  803.  
  804.   format.lccn output
  805.  
  806.  
  807.   format.price output
  808.  
  809.   new.block
  810.   note output
  811.   fin.entry
  812. }
  813.  
  814.  
  815. FUNCTION {booklet}
  816. { output.bibitem
  817.   format.authors output
  818.   new.block
  819.   format.title "title" output.check
  820.   howpublished address new.block.checkb
  821.   howpublished output
  822.   address output
  823.   format.date output
  824.  
  825.   format.isbn output
  826.  
  827.  
  828.   format.book.pages output
  829.  
  830.  
  831.   format.lccn output
  832.  
  833.  
  834.   format.price output
  835.  
  836.   new.block
  837.   note output
  838.   fin.entry
  839. }
  840.  
  841.  
  842.  
  843. FUNCTION {inbook}
  844. { output.bibitem
  845.   author empty$
  846.     { format.editors "author and editor" output.check }
  847.     { format.authors output.nonnull
  848.       crossref missing$
  849.         { "author and editor" editor either.or.check }
  850.         'skip$
  851.       if$
  852.     }
  853.   if$
  854.   new.block
  855.   format.btitle "title" output.check
  856.   crossref missing$
  857.     { format.bvolume output
  858.       format.chapter.pages "chapter and pages" output.check
  859.       new.block
  860.       format.number.series output
  861.       new.sentence
  862.       publisher "publisher" output.check
  863.       address output
  864.     }
  865.     { format.chapter.pages "chapter and pages" output.check
  866.       new.block
  867.       format.book.crossref output.nonnull
  868.     }
  869.   if$
  870.   format.edition output
  871.   format.date "year" output.check
  872.  
  873.   format.isbn output
  874.  
  875.  
  876.   format.lccn output
  877.  
  878.  
  879.   format.price output
  880.  
  881.   new.block
  882.   note output
  883.   fin.entry
  884. }
  885.  
  886.  
  887. FUNCTION {incollection}
  888. { output.bibitem
  889.   format.authors "author" output.check
  890.   new.block
  891.   format.title "title" output.check
  892.   new.block
  893.   crossref missing$
  894.     { format.in.ed.booktitle "booktitle" output.check
  895.       format.bvolume output
  896.       format.number.series output
  897.       format.chapter.pages output
  898.       new.sentence
  899.       publisher "publisher" output.check
  900.       address output
  901.       format.edition output
  902.       format.date "year" output.check
  903.     }
  904.     { format.incoll.inproc.crossref output.nonnull
  905.       format.chapter.pages output
  906.     }
  907.   if$
  908.  
  909.   format.isbn output
  910.  
  911.  
  912.   format.lccn output
  913.  
  914.  
  915.   format.price output
  916.  
  917.   new.block
  918.   note output
  919.   fin.entry
  920. }
  921.  
  922.  
  923. FUNCTION {inproceedings}
  924. { output.bibitem
  925.   format.authors "author" output.check
  926.   new.block
  927.   format.title "title" output.check
  928.   new.block
  929.   crossref missing$
  930.     { format.in.ed.booktitle "booktitle" output.check
  931.       format.bvolume output
  932.       format.number.series output
  933.       format.pages output
  934.       address empty$
  935.         { organization publisher new.sentence.checkb
  936.           organization output
  937.           publisher output
  938.           format.date "year" output.check
  939.         }
  940.         { address output.nonnull
  941.           format.date "year" output.check
  942.           new.sentence
  943.           organization output
  944.           publisher output
  945.         }
  946.       if$
  947.     }
  948.     { format.incoll.inproc.crossref output.nonnull
  949.       format.pages output
  950.     }
  951.   if$
  952.  
  953.   format.isbn output
  954.  
  955.  
  956.   format.lccn output
  957.  
  958.  
  959.   format.price output
  960.  
  961.   new.block
  962.   note output
  963.   fin.entry
  964. }
  965.  
  966.  
  967. FUNCTION {conference} { inproceedings }
  968.  
  969.  
  970. FUNCTION {manual}
  971. { output.bibitem
  972.   author empty$
  973.     { organization empty$
  974.         'skip$
  975.         { organization output.nonnull
  976.           address output
  977.         }
  978.       if$
  979.     }
  980.     { format.authors output.nonnull }
  981.   if$
  982.   new.block
  983.   format.btitle "title" output.check
  984.   author empty$
  985.     { organization empty$
  986.         { address new.block.checka
  987.           address output
  988.         }
  989.         'skip$
  990.       if$
  991.     }
  992.     { organization address new.block.checkb
  993.       organization output
  994.       address output
  995.     }
  996.   if$
  997.   format.edition output
  998.   format.date output
  999.  
  1000.   format.price output
  1001.  
  1002.   new.block
  1003.   note output
  1004.   fin.entry
  1005. }
  1006.  
  1007.  
  1008. FUNCTION {mastersthesis}
  1009. { output.bibitem
  1010.   format.authors "author" output.check
  1011.   new.block
  1012.   format.title "title" output.check
  1013.   new.block
  1014.   "Master's thesis" format.thesis.type output.nonnull
  1015.   school "school" output.check
  1016.   address output
  1017.   format.date "year" output.check
  1018.   new.block
  1019.   note output
  1020.   fin.entry
  1021. }
  1022.  
  1023.  
  1024. FUNCTION {misc}
  1025. { output.bibitem
  1026.   format.authors output
  1027.   title howpublished new.block.checkb
  1028.   format.title output
  1029.   howpublished new.block.checka
  1030.   howpublished output
  1031.   format.date output
  1032.  
  1033.   format.issn output
  1034.  
  1035.  
  1036.   format.price output
  1037.  
  1038.   new.block
  1039.   note output
  1040.   fin.entry
  1041.   empty.misc.check
  1042. }
  1043.  
  1044.  
  1045. FUNCTION {phdthesis}
  1046. { output.bibitem
  1047.   format.authors "author" output.check
  1048.   new.block
  1049.   format.btitle "title" output.check
  1050.   new.block
  1051.   "PhD thesis" format.thesis.type output.nonnull
  1052.   school "school" output.check
  1053.   address output
  1054.   format.date "year" output.check
  1055.   new.block
  1056.   note output
  1057.   fin.entry
  1058. }
  1059.  
  1060.  
  1061. FUNCTION {periodical}
  1062. { output.bibitem
  1063.   editor empty$
  1064.     { organization output }
  1065.     { format.editors output.nonnull }
  1066.   if$
  1067.   new.block
  1068.   title emphasize "title" output.check
  1069.   format.vol.num.pages output
  1070.   format.date output
  1071.  
  1072.   format.issn output
  1073.  
  1074.  
  1075.   format.price output
  1076.  
  1077.   new.sentence
  1078.   publisher output
  1079.   address output
  1080.   howpublished new.block.checka
  1081.   howpublished output
  1082.   new.block
  1083.   note output
  1084.   fin.entry
  1085. }
  1086.  
  1087.  
  1088. FUNCTION {proceedings}
  1089. { output.bibitem
  1090.   editor empty$
  1091.     { organization output }
  1092.     { format.editors output.nonnull }
  1093.   if$
  1094.   new.block
  1095.   format.btitle "title" output.check
  1096.   format.bvolume output
  1097.   format.number.series output
  1098.   address empty$
  1099.     { editor empty$
  1100.         { publisher new.sentence.checka }
  1101.         { organization publisher new.sentence.checkb
  1102.           organization output
  1103.         }
  1104.       if$
  1105.       publisher output
  1106.       format.date "year" output.check
  1107.     }
  1108.     { address output.nonnull
  1109.       format.date "year" output.check
  1110.       new.sentence
  1111.       editor empty$
  1112.         'skip$
  1113.         { organization output }
  1114.       if$
  1115.       publisher output
  1116.     }
  1117.   if$
  1118.  
  1119.   format.isbn output
  1120.  
  1121.  
  1122.   format.lccn output
  1123.  
  1124.  
  1125.   format.price output
  1126.  
  1127.   new.block
  1128.   note output
  1129.   fin.entry
  1130. }
  1131.  
  1132.  
  1133. FUNCTION {techreport}
  1134. { output.bibitem
  1135.   format.authors "author" output.check
  1136.   new.block
  1137.   format.title "title" output.check
  1138.   new.block
  1139.   format.tr.number output.nonnull
  1140.   institution "institution" output.check
  1141.   address output
  1142.   format.date "year" output.check
  1143.  
  1144.   format.book.pages output
  1145.  
  1146.  
  1147.   format.price output
  1148.  
  1149.   new.block
  1150.   note output
  1151.   fin.entry
  1152. }
  1153.  
  1154.  
  1155. FUNCTION {unpublished}
  1156. { output.bibitem
  1157.   format.authors "author" output.check
  1158.   new.block
  1159.   format.title "title" output.check
  1160.   new.block
  1161.   note "note" output.check
  1162.   format.date output
  1163.   fin.entry
  1164. }
  1165.  
  1166.  
  1167. FUNCTION {default.type} { misc }
  1168.  
  1169.  
  1170.  
  1171.  
  1172. MACRO {jan} {"January"}
  1173.  
  1174. MACRO {feb} {"February"}
  1175.  
  1176. MACRO {mar} {"March"}
  1177.  
  1178. MACRO {apr} {"April"}
  1179.  
  1180. MACRO {may} {"May"}
  1181.  
  1182. MACRO {jun} {"June"}
  1183.  
  1184. MACRO {jul} {"July"}
  1185.  
  1186. MACRO {aug} {"August"}
  1187.  
  1188. MACRO {sep} {"September"}
  1189.  
  1190. MACRO {oct} {"October"}
  1191.  
  1192. MACRO {nov} {"November"}
  1193.  
  1194. MACRO {dec} {"December"}
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.  
  1201. MACRO {acmcs} {"ACM Computing Surveys"}
  1202.  
  1203. MACRO {acta} {"Acta Informatica"}
  1204.  
  1205. MACRO {cacm} {"Communications of the ACM"}
  1206.  
  1207. MACRO {ibmjrd} {"IBM Journal of Research and Development"}
  1208.  
  1209. MACRO {ibmsj} {"IBM Systems Journal"}
  1210.  
  1211. MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  1212.  
  1213. MACRO {ieeetc} {"IEEE Transactions on Computers"}
  1214.  
  1215. MACRO {ieeetcad}
  1216.  {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  1217.  
  1218. MACRO {ipl} {"Information Processing Letters"}
  1219.  
  1220. MACRO {jacm} {"Journal of the ACM"}
  1221.  
  1222. MACRO {jcss} {"Journal of Computer and System Sciences"}
  1223.  
  1224. MACRO {scp} {"Science of Computer Programming"}
  1225.  
  1226. MACRO {sicomp} {"SIAM Journal on Computing"}
  1227.  
  1228. MACRO {tocs} {"ACM Transactions on Computer Systems"}
  1229.  
  1230. MACRO {tods} {"ACM Transactions on Database Systems"}
  1231.  
  1232. MACRO {tog} {"ACM Transactions on Graphics"}
  1233.  
  1234. MACRO {toms} {"ACM Transactions on Mathematical Software"}
  1235.  
  1236. MACRO {toois} {"ACM Transactions on Office Information Systems"}
  1237.  
  1238. MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  1239.  
  1240. MACRO {tcs} {"Theoretical Computer Science"}
  1241.  
  1242.  
  1243.  
  1244.  
  1245. READ
  1246.  
  1247.  
  1248.  
  1249.  
  1250. FUNCTION {sortify}
  1251. { purify$
  1252.   "l" change.case$
  1253. }
  1254.  
  1255. INTEGERS { len }
  1256.  
  1257. FUNCTION {chop.word}
  1258. { 's :=
  1259.   'len :=
  1260.   s #1 len substring$ =
  1261.     { s len #1 + global.max$ substring$ }
  1262.     's
  1263.   if$
  1264. }
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271. INTEGERS { et.al.char.used }
  1272.  
  1273. FUNCTION {initialize.et.al.char.used}
  1274. { #0 'et.al.char.used :=
  1275. }
  1276.  
  1277. EXECUTE {initialize.et.al.char.used}
  1278.  
  1279. FUNCTION {format.lab.names}
  1280. { 's :=
  1281.   s num.names$ 'numnames :=
  1282.   numnames #1 >
  1283.     { numnames #4 >
  1284.         { #3 'namesleft := }
  1285.         { numnames 'namesleft := }
  1286.       if$
  1287.       #1 'nameptr :=
  1288.       ""
  1289.         { namesleft #0 > }
  1290.         { nameptr numnames =
  1291.             { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  1292.                 { "{\etalchar{+}}" *
  1293.                   #1 'et.al.char.used :=
  1294.                 }
  1295.                 { s nameptr "{v{}}{l{}}" format.name$ * }
  1296.               if$
  1297.             }
  1298.             { s nameptr "{v{}}{l{}}" format.name$ * }
  1299.           if$
  1300.           nameptr #1 + 'nameptr :=
  1301.           namesleft #1 - 'namesleft :=
  1302.         }
  1303.       while$
  1304.       numnames #4 >
  1305.         { "{\etalchar{+}}" *
  1306.           #1 'et.al.char.used :=
  1307.         }
  1308.         'skip$
  1309.       if$
  1310.     }
  1311.     { s #1 "{v{}}{l{}}" format.name$
  1312.       duplicate$ text.length$ #2 <
  1313.         { pop$ s #1 "{ll}" format.name$ #3 text.prefix$ }
  1314.         'skip$
  1315.       if$
  1316.     }
  1317.   if$
  1318. }
  1319.  
  1320. FUNCTION {author.key.label}
  1321. { author empty$
  1322.     { key empty$
  1323.  
  1324.         { cite$ #1 #3 substring$ }
  1325.  
  1326.         { key #3 text.prefix$ }
  1327.       if$
  1328.     }
  1329.     { author format.lab.names }
  1330.   if$
  1331. }
  1332.  
  1333. FUNCTION {author.editor.key.label}
  1334. { author empty$
  1335.     { editor empty$
  1336.         { key empty$
  1337.  
  1338.             { cite$ #1 #3 substring$ }
  1339.  
  1340.             { key #3 text.prefix$ }
  1341.           if$
  1342.         }
  1343.         { editor format.lab.names }
  1344.       if$
  1345.     }
  1346.     { author format.lab.names }
  1347.   if$
  1348. }
  1349.  
  1350. FUNCTION {author.key.organization.label}
  1351. { author empty$
  1352.     { key empty$
  1353.         { organization empty$
  1354.  
  1355.             { cite$ #1 #3 substring$ }
  1356.  
  1357.             { "The " #4 organization chop.word #3 text.prefix$ }
  1358.           if$
  1359.         }
  1360.         { key #3 text.prefix$ }
  1361.       if$
  1362.     }
  1363.     { author format.lab.names }
  1364.   if$
  1365. }
  1366.  
  1367. FUNCTION {editor.key.organization.label}
  1368. { editor empty$
  1369.     { key empty$
  1370.         { organization empty$
  1371.  
  1372.             { cite$ #1 #3 substring$ }
  1373.  
  1374.             { "The " #4 organization chop.word #3 text.prefix$ }
  1375.           if$
  1376.         }
  1377.         { key #3 text.prefix$ }
  1378.       if$
  1379.     }
  1380.     { editor format.lab.names }
  1381.   if$
  1382. }
  1383.  
  1384. FUNCTION {calc.label}
  1385. { type$ "book" =
  1386.   type$ "inbook" =
  1387.   or
  1388.     'author.editor.key.label
  1389.     { type$ "proceedings" =
  1390.         'editor.key.organization.label
  1391.         { type$ "manual" =
  1392.             'author.key.organization.label
  1393.             'author.key.label
  1394.           if$
  1395.         }
  1396.       if$
  1397.     }
  1398.   if$
  1399.   duplicate$
  1400.   year field.or.null purify$ #-1 #2 substring$
  1401.   *
  1402.   'label :=
  1403.   year field.or.null purify$ #-1 #4 substring$
  1404.   *
  1405.   sortify 'sort.label :=
  1406. }
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416. FUNCTION {sort.format.names}
  1417. { 's :=
  1418.   #1 'nameptr :=
  1419.   ""
  1420.   s num.names$ 'numnames :=
  1421.   numnames 'namesleft :=
  1422.     { namesleft #0 > }
  1423.     { nameptr #1 >
  1424.         { "   " * }
  1425.         'skip$
  1426.       if$
  1427.  
  1428.       s nameptr "{vv{ } }{ll{ }}{  ff{ }}{  jj{ }}" format.name$ 't :=
  1429.  
  1430.       nameptr numnames = t "others" = and
  1431.         { "et al" * }
  1432.         { t sortify * }
  1433.       if$
  1434.       nameptr #1 + 'nameptr :=
  1435.       namesleft #1 - 'namesleft :=
  1436.     }
  1437.   while$
  1438. }
  1439.  
  1440.  
  1441. FUNCTION {sort.format.title}
  1442. { 't :=
  1443.   "A " #2
  1444.     "An " #3
  1445.       "The " #4 t chop.word
  1446.     chop.word
  1447.   chop.word
  1448.   sortify
  1449.   #1 global.max$ substring$
  1450. }
  1451.  
  1452.  
  1453. FUNCTION {author.sort}
  1454. { author empty$
  1455.     { key empty$
  1456.         { "to sort, need author or key in " cite$ * warning$
  1457.           ""
  1458.         }
  1459.         { key sortify }
  1460.       if$
  1461.     }
  1462.     { author sort.format.names }
  1463.   if$
  1464. }
  1465.  
  1466. FUNCTION {author.editor.sort}
  1467. { author empty$
  1468.     { editor empty$
  1469.         { key empty$
  1470.             { "to sort, need author, editor, or key in " cite$ * warning$
  1471.               ""
  1472.             }
  1473.             { key sortify }
  1474.           if$
  1475.         }
  1476.         { editor sort.format.names }
  1477.       if$
  1478.     }
  1479.     { author sort.format.names }
  1480.   if$
  1481. }
  1482.  
  1483. FUNCTION {author.organization.sort}
  1484. { author empty$
  1485.     { organization empty$
  1486.         { key empty$
  1487.             { "to sort, need author, organization, or key in " cite$ * warning$
  1488.               ""
  1489.             }
  1490.             { key sortify }
  1491.           if$
  1492.         }
  1493.         { "The " #4 organization chop.word sortify }
  1494.       if$
  1495.     }
  1496.     { author sort.format.names }
  1497.   if$
  1498. }
  1499.  
  1500. FUNCTION {editor.organization.sort}
  1501. { editor empty$
  1502.     { organization empty$
  1503.         { key empty$
  1504.             { "to sort, need editor, organization, or key in " cite$ * warning$
  1505.               ""
  1506.             }
  1507.             { key sortify }
  1508.           if$
  1509.         }
  1510.         { "The " #4 organization chop.word sortify }
  1511.       if$
  1512.     }
  1513.     { editor sort.format.names }
  1514.   if$
  1515. }
  1516.  
  1517.  
  1518. FUNCTION {presort}
  1519.  
  1520. { calc.label
  1521.   sort.label
  1522.   "    "
  1523.   *
  1524.   type$ "book" =
  1525.  
  1526.   type$ "inbook" =
  1527.   or
  1528.     'author.editor.sort
  1529.     { type$ "proceedings" =
  1530.         'editor.organization.sort
  1531.         { type$ "manual" =
  1532.             'author.organization.sort
  1533.             'author.sort
  1534.           if$
  1535.         }
  1536.       if$
  1537.     }
  1538.   if$
  1539.  
  1540.   *
  1541.  
  1542.   "    "
  1543.   *
  1544.   year field.or.null sortify
  1545.   *
  1546.   "    "
  1547.   *
  1548.   title field.or.null
  1549.   sort.format.title
  1550.   *
  1551.   #1 entry.max$ substring$
  1552.   'sort.key$ :=
  1553. }
  1554.  
  1555. ITERATE {presort}
  1556.  
  1557.  
  1558. SORT
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567. STRINGS { longest.label last.sort.label next.extra }
  1568.  
  1569. INTEGERS { longest.label.width last.extra.num }
  1570.  
  1571. FUNCTION {initialize.longest.label}
  1572. { "" 'longest.label :=
  1573.   #0 int.to.chr$ 'last.sort.label :=
  1574.   "" 'next.extra :=
  1575.   #0 'longest.label.width :=
  1576.   #0 'last.extra.num :=
  1577. }
  1578.  
  1579. FUNCTION {forward.pass}
  1580. { last.sort.label sort.label =
  1581.     { last.extra.num #1 + 'last.extra.num :=
  1582.  
  1583.       last.extra.num "z" chr.to.int$ >
  1584.  
  1585.     % Generate -1, -2, ... suffixes
  1586.     { "-" last.extra.num "a" chr.to.int$ - #1 + int.to.str$ * 'extra.label := }
  1587.     % Generate a, b, ..., z suffixes
  1588.         { last.extra.num int.to.chr$ 'extra.label := }
  1589.       if$
  1590.     }
  1591.     { "a" chr.to.int$ 'last.extra.num :=
  1592.       "" 'extra.label :=
  1593.       sort.label 'last.sort.label :=
  1594.     }
  1595.   if$
  1596. }
  1597.  
  1598. FUNCTION {reverse.pass}
  1599. {
  1600.  
  1601.   next.extra "b" =
  1602.     { "a" 'extra.label := }
  1603.     'skip$
  1604.   if$
  1605.  
  1606.   label extra.label * 'label :=
  1607.   label width$ longest.label.width >
  1608.     { label 'longest.label :=
  1609.       label width$ 'longest.label.width :=
  1610.     }
  1611.     'skip$
  1612.   if$
  1613.   extra.label 'next.extra :=
  1614. }
  1615.  
  1616. EXECUTE {initialize.longest.label}
  1617.  
  1618. ITERATE {forward.pass}
  1619.  
  1620. REVERSE {reverse.pass}
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627. FUNCTION {begin.bib}
  1628.  
  1629. { et.al.char.used
  1630.     { "\newcommand{\etalchar}[1]{$^{#1}$}" write$ newline$ }
  1631.     'skip$
  1632.   if$
  1633.   preamble$ empty$
  1634.  
  1635.     'skip$
  1636.     { preamble$ write$ newline$ }
  1637.   if$
  1638.   "\begin{thebibliography}{"  longest.label  * "}" * write$ newline$
  1639. }
  1640.  
  1641. EXECUTE {begin.bib}
  1642.  
  1643. EXECUTE {init.state.consts}
  1644.  
  1645.  
  1646. ITERATE {call.type$}
  1647.  
  1648.  
  1649. FUNCTION {end.bib}
  1650. { newline$
  1651.   "\end{thebibliography}" write$ newline$
  1652. }
  1653.  
  1654. EXECUTE {end.bib}
  1655.